Apply a class to <em>'s containing Japanese characters#94
Merged
Conversation
potato4d
reviewed
Feb 7, 2019
| const visit = require('unist-util-visit'); | ||
|
|
||
| const hasJapanese = str => { | ||
| return /[\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf。、]/.test(str); |
Member
There was a problem hiding this comment.
[imo]
hasJapanese から推測できますが、一応 regex の範囲についてコメントしておいても良いかもしれません。
Member
Author
There was a problem hiding this comment.
念のため確認してたらCJK統合漢字のコードポイント間違ってました…(コピペ元から間違ってました)
Member
Author
|
@potato4d コメントを加えてみましたが、ああいうことでよかったでしょうか |
Member
|
@smikitky 良いと思います〜! |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This fixes #22 .
em-jaclass to<em>'s that contain any Japanese character..em-jawith bold instead of italic.環境によって日本語で em が正しくレンダリングされない問題を修正します。em で強調されている文字列に日本語文字が含まれている場合(例:
*あああ*)、問答無用で太字にします。もし
yarn devで太字が反映されない場合はyarn resetでキャッシュを削除してみてください。